package com.vm.osm.business.dto.eam.equ_part;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.MoreObjects;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * 批量新增设备配件请求
 *
 * @author Xuerong Xue
 */
@Data
public class BatchAddEamEquPartReq implements Serializable {

    @ApiModelProperty("配件列表")
    private List<EquPart> equ_part_list;
    @ApiModelProperty(value = "会话Id", hidden = true)
    @JsonIgnore
    private String session_id;
    @ApiModelProperty(value = "企业Id", hidden = true)
    @JsonIgnore
    private String enterprise_id;

    @Data
    public static class EquPart {
        @ApiModelProperty("品牌")
        private String brand;
        @ApiModelProperty("配件类型编号")
        private String equ_part_type_id;
        @ApiModelProperty("生产厂家")
        private String manufactor_id;
        @ApiModelProperty("计量单位")
        private String measure_unit;
        @ApiModelProperty("型号")
        private String model;
        @ApiModelProperty("原值")
        private String original_value;
        @ApiModelProperty("pn")
        private String pn;
        @ApiModelProperty("购买日期")
        private String purchase_date;
        @ApiModelProperty("sn")
        private String sn;
        @ApiModelProperty("规格")
        private String spec;
        @ApiModelProperty("供应商")
        private String supplier_id;
        @ApiModelProperty("质保日期")
        private String warranty_date;

        @Override
        public String toString() {
            return MoreObjects.toStringHelper(this)
                    .add("brand", brand)
                    .add("equ_part_type_id", equ_part_type_id)
                    .add("manufactor_id", manufactor_id)
                    .add("measure_unit", measure_unit)
                    .add("model", model)
                    .add("original_value", original_value)
                    .add("pn", pn)
                    .add("purchase_date", purchase_date)
                    .add("sn", sn)
                    .add("spec", spec)
                    .add("supplier_id", supplier_id)
                    .add("warranty_date", warranty_date)
                    .toString();
        }
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("session_id", session_id)
                .add("enterprise_id", enterprise_id)
                .add("equ_part_list", null == equ_part_list ? null : Arrays.toString(equ_part_list.toArray()))
                .toString();
    }
}
